I don't think many of my friends will use the float type in mysql, especially when we use money, we may use double precision, we know that the float type of mysql is a single-precision floating point type, which may cause data errors accidentally.
I
Think a lot of friends are not how to use the float type in MySQL, especially when it comes to money we may use double precision, we know that the type of float of MySQL is single precision floating point type is careless will cause data
Usage of float type in mysql bitsCN.com
A single-precision floating point uses 4-byte (32bit) to represent a floating point.A computer floating point number that adopts the IEEE754 standard is represented in binary format internally.For example, 7.22
Single-precision floating-point numbers are 4 bytes (32bit) representing floating point numbersUses the IEEE754 standard computer floating-point number, in the interior is uses the binary system to representFor example: 7.22 with a 32-bit binary is
A single-precision floating point uses 4-byte (32bit) to represent a floating point.A computer floating point number that adopts the IEEE754 standard is represented in binary format internally.For example, 7.22 cannot be expressed in 32-bit
Single-precision floating-point numbers are 4 bytes (32bit) representing floating point numbersUses the IEEE754 standard computer floating-point number, in the interior is uses the binary system to representFor example: 7.22 with a 32-bit binary is
Mysql float double type 1. float Type float column type default length cannot be found, you must specify the precision, such as num float, insert into table (num) values (0.12); select * from table where num = 0.12, empty set. Num float (0.12),
Float and decimal type bitsCN.com in MySQL
Float and decimal types in MySQL
Float and double are prone to errors. when the precision requirements are relatively high, decimal is recommended for storage. decimal is stored in mysql memory as a
1.float typeThe default length of the float column type does not find the result. Precision must be specified.For example , num float, INSERT into table (num) values (0.12); Select * FROM table where num=0.12 words. Empty set.Num Float (9,7),
1.float typeFloat column Type default length cannot find results, you must specify precision,For example , num float, INSERT into table (num) values (0.12); Select * from table where num=0.12, empty set.Num Float (9,7), insert into table (num)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.